<body>
<script>
    //nav部分控制用户的脚本
    isLogin = "{COOKIE_isLogin}";
    $(document).ready(function () {
        if (isLogin === "yes"){
            let nickname = "{COOKIE_nickname}";
            let userCenter = "{TEXT_USER_CENTER}";
            let logoff = "{TEXT_LOGOFF}";
            let isAdmin = "{COOKIE_isAdmin}" === "yes";
            if (isAdmin){
                $("#nav-right").append('<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">' + nickname + ' <b class="caret"></b></a><ul class="dropdown-menu" role="menu"><li><a href="{LINK_usercenter}">' + userCenter + '</a></li><li><a href="{LINK_admin}">{TEXT_SYSTEM_SETTING}</a></li><li><a href="./?/logoff">' + logoff + '</a></li></ul></li>');
            }else {
                $("#nav-right").append('<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">' + nickname + ' <b class="caret"></b></a><ul class="dropdown-menu" role="menu"><li><a href="{LINK_usercenter}">' + userCenter + '</a></li><li><a href="{LINK_logoff}">' + logoff + '</a></li></ul></li>');
            }
        }else {
            $("#nav-right").append('<li><a href="{LINK_login}">{TEXT_LOGIN}</a></li>').append('<li><a href="{LINK_register}">{TEXT_REGISTER}</a></li>');
        }
    });
</script>
<nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse-example">
                <span class="sr-only"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{LINK_index}">Chat</a>
        </div>
        <div class="collapse navbar-collapse navbar-collapse-example">
            <ul class="nav navbar-nav">
                <li class="active"><a href="{LINK_index}">{TEXT_HOME}</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">{TEXT_CHOOSE_ROOM} <b class="caret"></b></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="{LINK_chooseRoom}">{TEXT_CHOOSE_ROOM}</a></li>
                        <li><a href="{LINK_backRoom}">{TEXT_BACK_ROOM}</a></li>
                        <li><a href="./?/goto_room">前往测试聊天室</a></li>
                        <li><a href="./?/goto_room&xcid=daimu">前往戴慕的聊天室</a></li>
                    </ul>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">{TEXT_FRIEND_LINKS} <b class="caret"></b></a>
                    <ul class="dropdown-menu" role="menu">
                        {FriendLinks}
                    </ul>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">{TEXT_LANGUAGE_NAME} <b class="caret"></b></a>
                    <ul class="dropdown-menu" role="menu">
                        {LanguageList}
                    </ul>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">{TEXT_HELP} <b class="caret"></b></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="{LINK_help}">{TEXT_HELP}</a></li>
                        <li><a href="{LINK_about}">{TEXT_ABOUT}</a></li>
                    </ul>
                </li>
            </ul>
            <ul class="nav navbar-nav navbar-right" id="nav-right">

            </ul>
        </div>
    </div>
</nav>